package com.base.sms.model.enums;

/**
 * @author
 * 存储类型
 */
public enum RepositoryTypeEnum {
	/**
	 * 内存存储
	 */
	MEMORY("MEMORY", "内存存储方式"),

	/**
	 * Redis存储
	 */
	REDIS("REDIS", "redis存储方式")
	;


	/**
	 * 类型
	 */
	private final String type;
	/**
	 * 描述
	 */
	private final String description;

    RepositoryTypeEnum(String type, String description) {
        this.type = type;
        this.description = description;
    }

    public String type() {
        return this.type;
    }

    public String description() {
        return this.description;
    }

	public static String getValue(String value) {
		RepositoryTypeEnum[] businessModeEnums = values();
		for (RepositoryTypeEnum businessModeEnum : businessModeEnums) {
			if (businessModeEnum.type().equals(value)) {
				return businessModeEnum.type();
			}
		}
		return null;
	}

	public static String getDesc(String value) {
		RepositoryTypeEnum[] businessModeEnums = values();
		for (RepositoryTypeEnum businessModeEnum : businessModeEnums) {
			if (businessModeEnum.type().equals(value)) {
				return businessModeEnum.description();
			}
		}
		return null;
	}

}
